#ifndef __MARS_GRAPHICS_LIGHT_H__
#define __MARS_GRAPHICS_LIGHT_H__

#include "MarsGameObject.h"

using namespace GObject;

namespace Graphics
{

class Light : public GameObject
{
public:
	enum LightType
	{
		LT_Unknown					= -1,
		LT_DirectionalLight			=  0,
		LT_PointLight				=  1,
		LT_SpotLight				=  2,
	};
public:
									Light( LightType eType			= LT_Unknown, 
										   const XMFLOAT4& ambient  = XMFLOAT4( 1.0f, 1.0f, 1.0f, 1.0f ), 
										   const XMFLOAT4& diffuse  = XMFLOAT4( 1.0f, 1.0f, 1.0f, 1.0f ), 
										   const XMFLOAT4& specular = XMFLOAT4( 1.0f, 1.0f, 1.0f, 1.0f ),
										   const XMFLOAT3& position = XMFLOAT3( 0.0f, 0.0f, 0.0f ),
										   const XMFLOAT3& target   = XMFLOAT3( 0.0f, 0.0f, 1.0f ) );
	virtual							~Light();

	LightType						GetLightType() const;

	void							SetAmbientColor( const XMFLOAT4& ambient );
	void							SetDiffuseColor( const XMFLOAT4& diffuse );
	void							SetSpecularColor( const XMFLOAT4& specular );
	void							SetPosition( const XMFLOAT3& position );
	void							SetTarget( const XMFLOAT3& target );

	const XMFLOAT4&					GetAmbientColor() const;
	const XMFLOAT4&					GetDiffuseColor() const;
	const XMFLOAT4&					GetSpecularColor() const;
	const XMFLOAT3&					GetPosition() const;
	const XMFLOAT3&					GetTarget() const;

private:
	LightType						m_eType;

	XMFLOAT4						m_ambient;
	XMFLOAT4						m_diffuse;
	XMFLOAT4						m_specular;

	XMFLOAT3						m_position;
	XMFLOAT3						m_target;
};

typedef std::vector< Light > LightsList;

inline Light::Light( LightType eType, 
					 const XMFLOAT4& ambient, 
					 const XMFLOAT4& diffuse, 
					 const XMFLOAT4& specular, 
					 const XMFLOAT3& position,
					 const XMFLOAT3& target )
	: m_eType( eType )
	, m_ambient( ambient )
	, m_diffuse( diffuse )
	, m_specular( specular )
	, m_position( position )
	, m_target( target )
{
}

inline Light::~Light()
{

}

inline Light::LightType Light::GetLightType() const
{
	return m_eType;
}

inline void Light::SetAmbientColor( const XMFLOAT4& ambient )
{
	m_ambient = ambient;
}

inline void Light::SetDiffuseColor( const XMFLOAT4& diffuse )
{
	m_diffuse = diffuse;
}

inline void Light::SetSpecularColor( const XMFLOAT4& specular )
{
	m_specular = specular;
}

inline void Light::SetPosition( const XMFLOAT3& position )
{
	m_position = position;
}

inline void Light::SetTarget( const XMFLOAT3& target )
{
	m_target = target;
}

inline const XMFLOAT4& Light::GetAmbientColor() const
{
	return m_ambient;
}

inline const XMFLOAT4& Light::GetDiffuseColor() const
{
	return m_diffuse;
}

inline const XMFLOAT4& Light::GetSpecularColor() const
{
	return m_specular;
}

inline const XMFLOAT3& Light::GetPosition() const
{
	return m_position;
}

inline const XMFLOAT3& Light::GetTarget() const
{
	return m_target;
}

} // end of namespace Graphics

#endif // end of #ifndef __MARS_GRAPHICS_LIGHT_H__